gldriver: Fix a possible use-after-free
authorMohammed Sadiq <sadiq@sadiqpk.org>
Mon, 26 Jun 2023 02:35:52 +0000 (08:05 +0530)
committerMohammed Sadiq <sadiq@sadiqpk.org>
Tue, 27 Jun 2023 17:15:07 +0000 (22:45 +0530)
commit64e27cd87dbedf944eba3aaec2326ae80c1ef027
tree3d001793d88ffaf644de2a90a4044f75da0f9cac
parent57eda94ddea6efb04778388a90d3349a008c1c64
gldriver: Fix a possible use-after-free

g_hash_table_insert() frees the given key if it already exists
in the hashtable.  But since we use the same pointer in the
following line, it will result in use-after-free.

So instead, insert the key only if it doesn't exist.
gsk/gl/gskgldriver.c